/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://github.com/mineadmin
 */
import type { MaFormItem } from "@mineadmin/form";
import type { UserVo } from "~/base/api/user.ts";
//@ts-ignore
import MaUploadImage from "@/components/ma-upload-image/index.vue";

export default function getFormItems(
  formType: "add" | "edit" = "add",
  t: any,
  model: UserVo
): MaFormItem[] {
  if (formType === "add") {
    // model.password = "123456";
  }


  return [
    {
      label: () => t('live.thumb'),
      prop: 'thumb',
      render: () => MaUploadImage,
    },
    {
      label: () => t("live.title"),
      prop: "title",
      render: "input",
      renderProps: {
        placeholder: t("form.pleaseInput", { msg: t("live.title") }),
      },
      itemProps: {
        rules: [
          {
            required: true,
            message: t("form.requiredInput", { msg: t("live.title") }),
          },
        ],
      },
    },
    {
      label: () => t("live.description"),
      prop: "description",
      render: "input",
      renderProps: {
        placeholder: t("form.pleaseInput", { msg: t("live.description") }),
        type:'textarea'
      },
      itemProps: {
        rules: [
          {
            required: true,
            message: t("form.requiredInput", { msg: t("live.thumb") }),
          },
        ],
      },
    },

  ];
}
